import 'package:flutter/material.dart';

List<String> cityNames = [
  '北京',
  '上海',
  '广州',
  '深圳',
  '杭州',
  '南京',
  '苏州',
  '武汉',
  '成都',
  '重庆',
  '西安',
  '厦门',
  '长沙',
];

class GridPage extends StatelessWidget {
  const GridPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('hello kitty'),
      ),
      body: GridView.count(
        crossAxisCount: 2,
        children: cityNames
            .map((e) => Container(
                  height: 80,
                  margin: EdgeInsets.only(bottom: 5, right: 5, left: 5),
                  alignment: Alignment.center,
                  color: Colors.yellow.withOpacity(0.5),
                  child: Text(e),
                ))
            .toList(),
      ),
    );
  }
}
